#ifndef _C_CODE_LOG_H_
#define _C_CODE_LOG_H_
#include <stdio.h>
#if (__ARMCC_VERSION >= 6010050)           /* 使用AC6编译器时 */
#else
#pragma diag_suppress 870 //防止printf打印中文时报警告
#endif
/*
*示例：LOG("INFO", "This is a %s message with number %d", "test", 123);
*输出：[INFO|main@your_file.c:your_line_number] This is a test message with number 123
*
*
*/
#define LOG_ENABLE 1
#if LOG_ENABLE == 1
#define LOG(level, format, ...) \
        printf("[%s|%s@%s:%d] " format "\r\n", \
            level, __func__, __FILE__, __LINE__, ##__VA_ARGS__ )
#else
#define LOG(level, format, ...) 
#endif
#endif // !_C_CODE_LOG_H_
